home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 3 / L'Effet Pommier - Volume 03.iso / Communication / HTMLedit173-ppc / HTML.edit 1.7.3 (ppc) / HTML.edit 1.7.3 (ppc).rsrc / TEXT_17247_Form menu.txt < prev    next >
Text File  |  1996-01-15  |  7KB  |  128 lines

  1.  
  2. Form Menu
  3.  
  4. Please consult online or printed sources for more information on implementing forms and form processing tools.
  5.  
  6. Each of the various form widgets is specified by one of three HTML elements: INPUT, SELECT, or TEXTAREA. All except Reset and Submit require a unique NAME attribute. Note that NAME is not displayed; it is a symbolic value used by the server to distinguish individual form elements.
  7.  
  8. A Submit element is mandatory in all forms except those containing only a single INPUT element of type TEXT (in which case Return in the text entry area submits the form) or at least one INPUT element of type IMAGE (in which case a click in the image submits the form). 
  9.  
  10. As they are not necessarily visually differentiated from the rest of an HTML document, it is recommended that forms be preceded and followed by a horizontal rule <HR>.
  11.  
  12. The Form menu contains:
  13.  
  14. New Form
  15. All form contents are surrounded by a beginning <FORM> and ending </FORM> tag. Any HTML elements are allowed in a form except another form. To create a new form, place the insertion point into your document where you wish the form to be placed, then select New Form from the Form menu. A dialog requests three attributes, the last one optional: 
  16.  
  17.    ACTION: a URL reference to the form processor (eg., a CGI script).
  18.    METHOD: either GET or POST. POST is recommended.
  19.    ENCTYPE: specifies the encoding method for the form contents.
  20.  
  21.    <FORM METHOD="post" ACTION="http://www.foo.com/cgi-bin/form.cgi">
  22.  
  23. INPUT
  24.  
  25. The INPUT element is used to specify a single input widget within a form. INPUT elements have no closing tag and do not surround any text. Each is designated by a different TYPE attribute ("text" is default):
  26.  
  27. TYPE=Text
  28. Displayed as a text entry field, with options for default contents (VALUE), physical size of the field (SIZE, default=20), and maximum number of characters (MAXLENGTH).
  29.  
  30.    <INPUT TYPE="text" NAME="question1" VALUE="username" SIZE=10 MAXLENGTH=16>
  31.  
  32. TYPE=Password
  33. Same attributes as "Text", but entered characters are not presented in a readable form.
  34.  
  35.    <INPUT TYPE="password" NAME="question2" SIZE=10 MAXLENGTH=10>
  36.  
  37. TYPE=Hidden
  38. Hidden form elements are not displayed to the user and each contain a NAME and VALUE pair. This can be read by the server to maintain "state" information over multiple connections to a server.
  39.  
  40.    <INPUT TYPE="hidden" NAME="form3" VALUE="z14:22:45/akoestler">
  41.  
  42. Note that while hidden elements are not displayed, they are not protected from being discovered using "View Source" on a browser.
  43.  
  44. TYPE=Radio
  45. Creates a single on or off toggle button; other toggles with the same NAME are grouped into "one of many" behavior. The VALUE attribute specifies the content of the button when it is "on". Including a CHECKED attribute specifies that this radio button is checked ("on") by default.
  46.  
  47.    <INPUT TYPE="radio" NAME="question3" VALUE="chicken" CHECKED>
  48.    <INPUT TYPE="radio" NAME="question3" VALUE="pork">
  49.    <INPUT TYPE="radio" NAME="question3" VALUE="fish">
  50.  
  51. TYPE=Checkbox
  52. Creates a single on or off toggle button, generally in the form of a checkbox (though this is strictly up to the browser). The VALUE attribute specifies the content of the button when it is "on". Including a CHECKED attribute specifies that this checkbox is checked ("on") by default.
  53.  
  54.    <INPUT TYPE="checkbox" NAME="question4" VALUE="Imrat Khan" CHECKED>
  55.    <INPUT TYPE="checkbox" NAME="question4" VALUE="Ali Akbar Khan">
  56.  
  57. TYPE=Image
  58. The Image widget displays an image similar to the IMG element with an ISMAP attribute. Clicking on the image records the location of the click in the form submission. Clicking on an image may also be used as the method by which the form is submitted.
  59.  
  60.    <INPUT NAME="Larry" TYPE="image" SRC="http://www.foo.com/images/durrell.gif">
  61.  
  62. TYPE=Reset
  63. Uses an optional VALUE atribute to specify the label for the pushbutton. 
  64.  
  65.    <INPUT TYPE="reset" VALUE="Start Over">
  66.  
  67. TYPE=Submit
  68. Uses an optional VALUE atribute to specify the label for the pushbutton. 
  69.  
  70.    <INPUT TYPE="submit" VALUE="Submit Form">
  71.  
  72. SELECT
  73.  
  74. Within a form any number of SELECT tags are allowed, freely intermixed with other HTML elements (including INPUT and TEXTAREA elements) and text (but not additional forms). How SELECT tags are displayed is up to the browser, but usually appear as option menus and scrolled lists. 
  75.  
  76. Unlike INPUT, SELECT has both opening and closing tags. Inside SELECT, only a sequence of
  77. OPTION tags, each followed by an arbitrary amount of plain text (no HTML markup) -- is
  78. allowed; for example: 
  79.  
  80.    <P><SELECT NAME="sea-adventures">
  81.    <OPTION>Conrad: Typhoon
  82.    <OPTION SELECTED>Conrad: Heart of Darkness
  83.    <OPTION>Conrad: The Secret Sharer
  84.    <OPTION>Dana: Two Years Before the Mast
  85.    <OPTION>Melville: Typee
  86.    <OPTION>Conrad: Youth
  87.    </SELECT></P>
  88.  
  89. The three attributes to SELECT are as follows: 
  90.  
  91.    NAME is the symbolic name for this SELECT element. NAME is required.
  92.  
  93.    SIZE: if SIZE=1 or if the SIZE attribute is missing, by default the SELECT will
  94.    be represented as an option menu. If SIZE is 2 or more, the SELECT will be
  95.    represented as a scrolled list; the value of SIZE then determines how many
  96.    items will be visible. 
  97.  
  98.    MULTIPLE, if present (no value), specifies that the SELECT should allow
  99.    multiple selections (n of many behavior). The presence of MULTIPLE forces
  100.    the SELECT to be represented as a scrolled list, regardless of the value of SIZE. 
  101.  
  102. The OPTION tag may have an optional SELECTED attribute that specifies that this option is selected by default. If the SELECT allows multiple selections (via the MULTIPLE attribute), multiple options can be specified as SELECTED. 
  103.  
  104. TEXTAREA
  105.  
  106. The TEXTAREA element can be used to place a multiline text entry field with optional default contents in a fill-out form. The attributes to TEXTAREA are as follows: 
  107.  
  108.    NAME is the symbolic name of the text entry field. 
  109.    ROWS is the number of rows (vertical height in characters) of the text entry field. 
  110.    COLS is the number of columns (horizontal width in characters) of the text entry field. 
  111.  
  112. TEXTAREA fields automatically have scrollbars; any amount of text can be entered in them. 
  113.  
  114. The TEXTAREA element requires both an opening and a closing tag. A TEXTAREA with no default contents looks like this: 
  115.  
  116.    <TEXTAREA NAME="foo" ROWS=4 COLS=40></TEXTAREA>
  117.  
  118. A TEXTAREA with default contents looks like this: 
  119.  
  120.    <TEXTAREA NAME="foo" ROWS=4 COLS=40>
  121.    Default contents go here.
  122.    </TEXTAREA>
  123.  
  124. The default contents must be straight ASCII text. Return characters are respected (so in the above example there will be a return both before and after "Default contents go here."). 
  125.  
  126. Back to Anchor menu, on to Table menu, or return to Tool Palette Menus.
  127.  
  128.